!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! calcaulate M,p,rou,T,c from V
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! coded by : B. G.
! created  : 2015-06-16
! revised  :
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! nomenclature:
!   V      velocity, m/s
!   p      pressure, Pa
!   rou    density, kg/m^3
!   T      temperature, K
!   M      Mach number
!   Cp     constant pressure specific heat
!   a      speed of sound, m/s
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

subroutine Thermo(V,p,rou,T,ag,M)
   use VariableDef
   implicit none
   real*8::V,p,rou,T,ag,M
   real*8::Cp
   
   Cp=g*Rg/(g-1)   
   T=Tt-V**2/(2*Cp)
   ag=sqrt(g*Rg*T)
   M=V/ag
   p=Pt*(T/Tt)**(g/(g-1.0))
   rou=p/(Rg*T)
end subroutine Thermo
